package org.lmind.example.common.core;

import java.util.ArrayList;
import java.util.Collections;

public class EventHolder<T> {
	
	private ArrayList<T> listeners = new ArrayList<T>();
	
	public void addEventListener(T listener) {
		listeners.add(listener);
	}
	
	public void removeEventListener(T listener) {
		listeners.remove(listener);
	}
	
	public Iterable<T> events() {
		return Collections.unmodifiableList(listeners);
	}
}
